package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.UserMapper;
import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public User getUserByIdByPass(String userId, String password) {
        User user=null;
        try {
            user=userMapper.getUserByIdByPass(userId,password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return user;
    }

    @Override
    public int saveUser(User user) {
        int result = 0;
        try {
            result=userMapper.saveUser(user);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}
